package hzk.codex2016.exam;

import java.math.BigDecimal;
 
class Accounts{
	
}
class MoneyServiceImpl  {
	public void transfer(String srcAccountId, String destAccountId, BigDecimal amount) throws Exception {

		BigDecimal srcBalance = queryBalance(srcAccountId);
		if (srcBalance.compareTo(amount) < 0)
			throw new Exception("not enough money");
		
		
		
			updateBalance(srcAccountId, amount.negate());
			updateBalance(destAccountId, amount);
		
	
	}
	
	public void updateBalance(String accountId,BigDecimal delta){}
	public BigDecimal queryBalance(String accountId){return null;}
}

public class AliExam160420P3 {
	public void process(String srcAccountId, String destAccountId, BigDecimal amount) throws Exception {
		
		//transfer(srcAccountId,middleMenId,amount);
		//transfer(middleMenId,destAccountId,amount);
		
	
	}
	public void transfer(String srcAccountId, String destAccountId, BigDecimal amount) {

	}

	public static void main(String[] args) {

	}

}
